<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>图片新闻管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">

		<li class="active"><a href="${ctx}/cms/exImage/?category.id=${exImage.category.id}">图片新闻列表</a></li>
        <shiro:hasPermission name="cms:exImage:edit"><li><a href="<c:url value='${fns:getAdminPath()}/cms/exImage/form?id=${exImage.id}&category.id=${exImage.category.id}'><c:param name='category.name' value='${exImage.category.name}'/></c:url>">图片新闻添加</a></li></shiro:hasPermission>
          <%--<shiro:hasPermission name="cms:exImage:edit"><li><a href="${ctx}/cms/exImage/form?category.id=${exImage.category.id}">图片新闻添加</a></li></shiro:hasPermission>--%>
		<%--<shiro:hasPermission name="cms:exImage:edit"><li><a href="${ctx}/cms/exImage/form">图片新闻添加</a></li></shiro:hasPermission>--%>
	</ul>
	<form:form id="searchForm" modelAttribute="exImage" action="${ctx}/cms/exImage/" method="post" class="breadcrumb form-search">
        <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
        <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
        <label>栏目：</label><sys:treeselect id="category" name="category.id" value="${exImage.category.id}" labelName="category.name" labelValue="${exImage.category.name}"
                                          title="栏目" url="/cms/category/treeData" module="exImage" notAllowSelectRoot="false" cssClass="input-small"/>
        <label>标题：</label><form:input path="title" htmlEscape="false" maxlength="50" class="input-small"/>&nbsp;
        <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
        <label>状态：</label><form:radiobuttons onclick="$('#searchForm').submit();" path="delFlag" items="${fns:getDictList('cms_del_flag')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>栏目名称</th>
				<th>图片名称</th>
				<th>创建时间</th>
				<th>更新时间</th>
				<shiro:hasPermission name="cms:exImage:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="exImage">
			<tr>
				<td>
                    ${exImage.category.name}
				</td>
				<td>
					${exImage.title}
				</td>
				<td>
					<fmt:formatDate value="${exImage.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					<fmt:formatDate value="${exImage.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<shiro:hasPermission name="cms:exImage:edit"><td>
    				<a href="${ctx}/cms/exImage/form?id=${exImage.id}">修改</a>
                <shiro:hasPermission name="cms:article:audit">
					<%--<a href="${ctx}/cms/exImage/delete?id=${exImage.id}" onclick="return confirmx('确认要删除该图片新闻吗？', this.href)">删除</a>--%>
                    <a href="${ctx}/cms/exImage/delete?id=${exImage.id}${exImage.delFlag ne 0?'&isRe=true':''}&categoryId=${exImage.category.id}" onclick="return confirmx('确认要${exImage.delFlag ne 0?'发布':'删除'}该文章吗？', this.href)" >${exImage.delFlag ne 0?'发布':'删除'}</a>
                </shiro:hasPermission>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>